using System;
using System.Text.RegularExpressions;

namespace WhySoSeries
{
    public static class ParseUtilities
    {
        public static Tuple<int, int> GetSeasonAndEpisodeNumbersFromString(string str)
        {
            Regex regex = new Regex(@"\s*S(\d+)E(\d+)\s*", RegexOptions.IgnoreCase);
            Match match = regex.Match(str);
            int seasonNumber = int.Parse(match.Groups[1].Value);
            int episodeNumber = int.Parse(match.Groups[2].Value);
            return new Tuple<int, int>(seasonNumber, episodeNumber);
        }
    }
}